package com.zm.bean;

import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Document
@Data
public class HeartBeatBean {

    @Id ObjectId databaseId;
    public ObjectId _ID;

    public HeartBeatBean() {
    }

    public HeartBeatBean(int id) {
        this.id = id;
        this.door = id + 1;
    }

    public String CAN_TAG = "bat";

    public int local;
    public int id;
    public int door;//门序号

    public String battery = "0000000000000000";
    public String cabinet = "0000000000000000";
    public String voltage = "0";//电压
    public String voltageDifference = "0";
    public String electric = "0";
    public String temperature = "0";
    public int loop = 0; //充电次数
    public int soc = 0;//电量
    public String totalMileage = "0";
    public String mileage = "0";
    public String hardwareVersion = "0";
    public String softwareVersion = "0";

    //电池厂家识别
    public int batFate;
    public String batFateStr = "";

    //仓位是否故障(0：正常、1：故障)
    public int isFault = 0;

    //黑名单锁仓(0：正常、1：故障)
    public int blackFault = 0;

    //最大单体电压
    public int maxmv;

    //电池状态 0 没有电池  1 电池无识别  2识别到ID 不符合  3预留
    public int barState;
    //io 微动开关 1 开 2 关
    public int ioState;
    //充电器开关状态 0开 1关
    public int chargingSwitchState;

    //door 卷帘门  1开 2关 3打开中
    public int doorState;
    //板载温度
    public double loadingTemp = 0;

    //充电器通信故障 0 无故障 1 故障
    public int failure0;
    //电池识别故障（微动动作电池没有数据）0 无故障 1 故障
    public int failure1;
    //电池厂家识别故障（电池厂家识别问题）0 无故障 1 故障
    public int failure2;
    //板载温度异常 0 无故障 1 故障
    public int failure3;
    //充电器开关异常 0 无故障 1 故障
    public int failure4;
    //微动故障 0 无故障 1 故障
    public int failure5;
    //卷帘门防夹功能启动 0 无故障 1 故障
    public int failure6;
    //控制板PCB地址异常（相同地址） 0 无故障 1 故障
    public int failure7;
    //门打开阻力报警 0 无故障 1 故障
    public int failureOpenDoor;
    //上位机心跳报警 0 无故障 1 故障
    public int failureAndroid;

    //三级报警2 板载温度计异常 0 无故障 1 故障
    public int boardThermometerFault;

    //电源设置电流A
    public int powerSettingCurrent = 0;
    //电源设置电压V
    public int powerSettingVoltage = 0;
    //电源当前电流A
    public int powerCurrent = 0;
    //电源当前电压V
    public int powerVoltage = 0;

    //充电器故障状态
    public int chargerFaultStatus = 0;
    //充电器ID
    public String chargerId;
    //充电器温度
    public int chargerTemp;

    //纠错程序计数
    public int chargingErrorCount = 0;

    //电池充电循环次数（读取）
    public int chargingCycles = 0;
    public double disChargingCycles = 0;

    //电池充电循环次数（计算）
    public double chargingCyclesSelf = 0;

    //通讯超时
    public boolean timeout = false;

    //充电器与主板通讯中（1拖2使用）0：不通信、1：通信
    public int chargingState = 1;
    //充电机通讯类型1拖2
    public int chargingType = 0;//0：1拖1、1：1拖2

    //防夹功能触发故障 0：正常、1：故障
    public int antiClampFault = 0;

    //超流出发的时间
    public long overCurrentTime = 0;

    //超压出发的时间
    public long overVoltageTime = 0;

    //最新更新数据时间
    public long updateTime = 0;

    public long time = 0;


}
